import request from '@/utils/request.js'

// 获取活动详情数据
export function getActivityDetail(data) {
	return request({
		'url': '/activity/activityInfo/info',
		'method': 'get',
		'data': data
	})
}

// 活动收藏
export function addActivityCollect(data) {
	return request({
		'url': '/activity/collection/addCollection',
		'method': 'post',
		'data': data
	})
}

// 取消活动收藏
export function delActivityCollect(data) {
	return request({
		'url': `/activity/collection/removeCollection?userId=${data.userId}&activityId=${data.activityId}`,
		'method': 'get'
	})
}



// 活动报名
export function activitySignUp(data) {
	return request({
		'url': '/activity/activityApplication/application',
		'method': 'post',
		'data': data
	})
}

// 创建订单(支付报名)
export function orderCreate(data) {
	return request({
		'url': '/activity/activityPay/createOrder',
		'method': 'post',
		'data': data
	})
}

// 查询支付订单
export function findOrder(outTradeNo) {
	return request({
		'url': `/activity/activityPay/viewOrder?outTradeNo=${outTradeNo}`,
		'method': 'get'
	})
}

// 查询支付订单
export function refund(data) {
	return request({
		'url': `/activity/activityPay/batchRefund`,
		'method': 'post',
		data
	})
}
